import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';

//服务组件配置管理单条查询
export const querySysMicroServiceComponent = (params) => {
  params.head.transCode = 'querySysMicroServiceComponent';
  return request({
    url: '/micro/sysMicroServiceComponent/querySysMicroServiceComponent',
    method: 'post',
    data: params
  })
}
//服务组件配置管理多条列表查询，支持条件查询
export const querySysMicroServiceComponentListPage = (params) => {
  params.head.transCode = 'querySysMicroServiceComponentListPage';
  return request({
    url: '/micro/sysMicroServiceComponent/querySysMicroServiceComponentListPage',
    method: 'post',
    data: params
  })
}
//服务组件配置管理新增单条记录
export const saveSysMicroServiceComponent = (params) => {
  params.head.transCode = 'saveSysMicroServiceComponent';
  return request({
    url: '/micro/sysMicroServiceComponent/saveSysMicroServiceComponent',
    method: 'post',
    data: params
  })
}
//服务组件配置管理新增多条记录
export const saveSysMicroServiceComponentList = (params) => {
  params.head.transCode = 'saveSysMicroServiceComponentList';
  return request({
    url: '/micro/sysMicroServiceComponent/saveSysMicroServiceComponentList',
    method: 'post',
    data: params
  })
}
//服务组件配置管理新增或修改单条记录
export const saveOrUpdateSysMicroServiceComponent = (params) => {
  params.head.transCode = 'saveOrUpdateSysMicroServiceComponent';
  return request({
    url: '/micro/sysMicroServiceComponent/saveOrUpdateSysMicroServiceComponent',
    method: 'post',
    data: params
  })
}


//服务组件配置管理新增或修改单条记录
export const saveOrUpdateSysMicroServiceComponentList = (params) => {
  params.head.transCode = 'saveOrUpdateSysMicroServiceComponentList';
  return request({
    url: '/micro/sysMicroServiceComponent/saveOrUpdateSysMicroServiceComponentList',
    method: 'post',
    data: params
  })
}

//服务组件配置管理修改单条记录
export const updateSysMicroServiceComponent = (params) => {
  params.head.transCode = 'updateSysMicroServiceComponent';
  return request({
    url: '/micro/sysMicroServiceComponent/updateSysMicroServiceComponent',
    method: 'post',
    data: params
  })
}

//服务组件配置管理删除单条记录
export const deleteSysMicroServiceComponent = (params) => {
  params.head.transCode = 'deleteSysMicroServiceComponent';
  return request({
    url: '/micro/sysMicroServiceComponent/deleteSysMicroServiceComponent',
    method: 'post',
    data: params
  })
}

//服务组件配置管理删除多条记录
export const deleteSysMicroServiceComponentList = (params) => {
  params.head.transCode = 'deleteSysMicroServiceComponentList';
  return request({
    url: '/micro/sysMicroServiceComponent/deleteSysMicroServiceComponentList',
    method: 'post',
    data: params
  })
}
//服务组件配置管理导出excel
export const exportSysMicroServiceComponentExcel = (params) => {
  downloadExcel({
    url: '/micro/sysMicroServiceComponent/excelDownload/exportSysMicroServiceComponentExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
